﻿using Super_Management_Mayhem.Content.Spritesheet;
using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.GameObjects.Containers.Transformable_controls;
using Transformable_Engine_v2.Engine.GameObjects.Primitives;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Menu
{
    public class Title : Container
    {
        public Title(string text,
                     Color color,
                     TE_Vector2 size)
        {
            var rectangle = new RectanglePrimitive {
                                                       Shape = new TE_Rectangle(0.5f, 0.5f, size.X - 1, 3),
                                                       FillColor = color
                                                   };

            var title = new Label(MenuSheet.GetInstance().GetSpriteAlphabet<MenuSheet.LetterAlphabet>,
                                  text) {
                                            PositionGridBound = new TE_Vector2(1, 1),
                                            Scale = new TE_Vector2(2, 2),
                                            Color = Color.White,
                                        };

            AddChildren(rectangle, title);
        }

        public static Title Blue(string text,
                                 TE_Vector2 size)
        {
            return new Title(text, new Color(0, 93, 255), size);
        }

        public static Title Gray(string text,
                                 TE_Vector2 size)
        {
            return new Title(text, new Color(96, 96, 96), size);
        }
    }
}
